package com.jack.vipmis.vip.api.web.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jack.vipmis.common.web.controller.BaseController;
import com.jack.vipmis.vip.api.util.MsgUtil;
import com.jack.vipmis.vip.share.entity.ShareRecord;
import com.jack.vipmis.vip.share.service.ShareRecordService;

/**
 * 分享信息记录
 * 
 * @author JackLiang
 * @version 1.0
 * @date 2014-7-7
 */
@Controller
@RequestMapping(value = "api/share/")
public class ShareNotesApiController extends BaseController<ShareRecord, Long> {

	@Autowired
	private ShareRecordService	shareRecordService;

	/**
	 * 添加分享信息
	 * 
	 * @param shareInfos
	 */
	@RequestMapping(value = "add")
	@ResponseBody
	public Map<String, Object> addShareNotes(@RequestBody ShareRecord info) {
		try {
			ShareRecord m = shareRecordService.save(info);
			return MsgUtil.doneOk(m);
		} catch (Exception e) {
			e.printStackTrace();
			return MsgUtil.doneMsg(MsgUtil.REQUEST_ERROR_EXCEPTION, "系统异常了", null);
		}
	}

}
